<% content_for :sitemap do %>
  <span class="current"><%= t("cpanel.overview") %></span>
<% end %>

<div class="toolbar">
  <a href="/sidekiq" class="btn btn-default" target="_blank">异步任务</a>
  <a href="/cpanel/applications" class="btn btn-default" target="_blank">OAuth 应用</a>
</div>

<div class="row clearfix">
  <div class="col-sm-6">
    <h4><%= t("cpanel.recent_topics") %></h4>
    <ul>
      <% @recent_topics.each do |item| %>
      <li><a href="<%= edit_cpanel_topic_path(item) %>"><%= truncate(item.title, length: 50) %></a></li>
      <% end %>
    </ul>
  </div>

  <div class="col-sm-6">
    <h4><%= t("cpanel.statics") %></h4>
    <table class="table table-striped table-condensed">
      <tr><td style="width:60px;"><%= t("cpanel.menu.users") %></td><td><%= User.unscoped.count %> 人</td></tr>
      <tr><td><%= t("cpanel.menu.topics") %></td><td><%= Topic.unscoped.count %> 个</td></tr>
      <tr><td><%= t("cpanel.menu.replies") %></td><td><%= Reply.unscoped.count %> 条</td></tr>
      <tr><td><%= t("cpanel.menu.notes") %></td><td><%= Note.unscoped.count %> 条</td></tr>
      <tr><td>通知</td><td><%= Notification::Base.unscoped.count %> 条</td></tr>
      <tr><td>图片</td><td><%= Photo.unscoped.count %> 张</td></tr>
    </table>
  </div>
</div>

